package routes

import (
	"demo/controllers"

	"github.com/gin-gonic/gin"
)

func Load() *gin.Engine {
	r := gin.Default()
	v1 := r.Group("api/v1")
	routeList(v1)
	return r
}

// 路由定义
func routeList(g *gin.RouterGroup) {
	//测试
	g.GET("ping", func(c *gin.Context) {
		c.JSON(200, "pong")
	})
	g.POST("register", controllers.Register)
	g.POST("login", controllers.Login)
}
